class Solution {
    public int climbStairs(int n) {
        if (n == 1) {
            return n;
        }
        int db[] = new int[n + 1];
        db[1] = 1;
        db[2] = 2;
        for (int i = 3; i <= n; i++) {
            db[i] = db[i - 1] + db[i - 2];
        }
        return db[n];
    }
}